package com.salesystem.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.salesystem.dao.entity.Tbluser;
import com.salesystem.dao.entity.TbluserDAO;


@Service
public class UserLoginBiz {
	
	@Resource
	private TbluserDAO dao;
	
	public boolean login(Tbluser user){
		boolean flag=true;
		List<Tbluser> list = dao.findByUsername(user.getUsername());
		if(list.isEmpty()){
			flag=false;
		}else{
			list=dao.findByPassword(user.getPassword());
			if(list.isEmpty()){
				flag=false;
			}
		}
		return flag;
	}

}
